<%-- 
/*
Assignment 1
Class ID        : SE0691
Group           : 1
Due Date        : 20 November 2012
I declare that this assignment is my own work
in accordance with FPT Policy.
*/
--%>

<%@page import="edu.fpt.hib.Services"%>
<%@page import="edu.fpt.dal.ServicesDAL"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Delete Services</title>
        <style type="text/css"> <!--@import url("../style.css");--></style>
        <script>function goBack()  {  window.history.back()  }</script>
    </head>
    <body>
        <%@include file="template/header.jsp" %>

        <div id="page">

             <% try {
                    String id = request.getParameter("serviceid");
                    if (ServicesDAL.getByServicesID(id)==null ) {

            %>
            Services not found! <input class="searchsubmit" type='button' value='Back' onclick='goBack()'>
            <% } else {
                Services ser = ServicesDAL.getByServicesID(id);
                if (request.getParameter("error") == null) {
            %>
            <h2 class="title">You want to delete : <%=ser.getServiceName() %></h2>
            <h4 class="title"><font color="red">Remember that this transaction cannot be rollback</font></h4>
            <strong>Service ID</strong><br>
            <%=ser.getServiceId()%><br>
            <strong>Name</strong><br>
            <%=ser.getServiceName() %><br>
            <strong>Price</strong><br>
            <%=ser.getServicePrice() %>
            <%}%>

            <form method="post" action="../DeleteService">
                <input type="hidden" value="<%=ser.getServiceId()%>" name="serviceid">
                <input class="searchsubmit" type="submit" value="OK! Delete this service">
                <input class="searchsubmit" type='button' value='Back' onclick='goBack()'>
            </form>
            <%
                }}catch(Exception e){
                    out.println("Error: "+e.getMessage());%>
                    <br><input class="searchsubmit" type='button' value='Back' onclick='goBack()'>
                <%}
            %>
        </div>
        <%@include file="template/footer.jsp" %>
    </body>
</html>
